﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using DataAccess.SlideWin;
using FOModels.SlideWin;
namespace Bussiness.SlideWin
{
    public class SlideWinBLL
    {
        private SlideWinDAL dal;
        public SlideWinBLL()
        {
            dal = new SlideWinDAL();
        }
        public List<SlideWinModels> getmenubytypeid(int positionid, int langid)
        {
            List<SlideWinModels> list = new List<SlideWinModels>();
            DataTable tb = dal.getslidewinbyposid(positionid, langid);
            if (tb != null)
            {
                SlideWinModels menu;
                foreach (DataRow r in tb.Rows)
                {
                    menu = new SlideWinModels();
                    menu.SlideWinID = int.Parse(r[0].ToString());
                    menu.SlideWinPositionID = int.Parse(r[1].ToString());
                    menu.Name = r[8].ToString();
                    menu.Img = r[3].ToString();
                    menu.Links = r[4].ToString();
                    menu.Target = r[5].ToString();
                    list.Add(menu);
                }
            }
            return list;
        }

    }
}
